<div><?php
$cddbid = $_GET['cddbid'];
mysql_select_db($DB_NAME, $view_connect);
$albumsql = "SELECT * FROM `album` WHERE `cddbid`='".mysql_real_escape_string($cddbid)."' LIMIT 1";
$albumresult = mysql_query($albumsql);
$albumrow = mysql_fetch_array($albumresult);
?>
<?php 
print('<h3>"' . $albumrow[title] . '" by ' . $albumrow[artist] . '</h3>' . @mysql_result(mysql_query("SELECT `category` FROM `category` WHERE `id`='".mysql_real_escape_string($albumrow[category])."' LIMIT 1 "), 0) . ' slot #<span style="font-weight: bold;">' . $albumrow[slot] . $albumrow[multi] . '</span><br /><div style="width: 450px; text-align: justify;">' . $albumrow[review] . '</div><br /><br />');
$tracksql = "SELECT * FROM `track` WHERE `cddbid`='".mysql_real_escape_string($cddbid)."' ORDER BY `trackno` ";
$trackresult = mysql_query($tracksql);
?>
<table>
<tr><th> </th><th>Req</th><th>#</th><th>title</th><th>comments/artist</th></tr>
<?php
while ($trackrow = mysql_fetch_array($trackresult)){
?>
<form name="insert_<?=$albumrow[cddbid]?>" action="<?=$_SERVER[PHP_SELF]?>" method="post">
<tr class="virtue<?=$trackrow[virtue]?>">
	<td>
		<input type="hidden" name="mode" value="traffic" />
		<input type="hidden" name="do" value="air_add" />
		<input type="hidden" name="trackno" value="<?=$trackrow[trackno]?>" />
		<input type="hidden" name="cddbid" value="<?=$albumrow[cddbid]?>" />
		<input type="hidden" name="cat" value="<?=$cat?>" />
		<input type="submit" value="Log" />
	</td>
		<td>
		<!-- input type="checkbox" name="request" value="1" /-->
	</td>
	<td><?=$trackrow[trackno]?></td>
	<td><?=$trackrow[title]?></td>
	<td><?=$trackrow[artist]?><?=$trackrow[comment]?></td>
</tr>
</form>


<?php
}
/* Free resultset */
mysql_free_result($trackresult);
mysql_free_result($albumresult);
?>
</table>
<?php
echo('we\'re viewing CD #' . $cddbid . '!');
?>
</div>
